<?php

namespace app\index\model;

use function Clue\StreamFilter\fun;
use think\Model;

class Order extends Model
{
      public static function init(){
           Order::event('before_write',function($order){
                 $isHas = Order::where(['ScheduleID'=>$order->ScheduleID,'Day'=>$order->Day])->count();
                 return $isHas ? false : true;
           });
      }
      public function customer(){
          return $this->hasOne('Customer','CustID','CustID');
      }
}
